home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / C Libraries / StringTools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.4 KB  |  40 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. /*=======================================================================*/
  4. /* This file contains a set of utilities for manipulating pascal strings */
  5. /*=======================================================================*/
  6.  
  7. #include <BDC.h>        // for number to string & vv conversion
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13.     StringPtr    String2String (StringPtr InString);
  14.     /* return a copy of the passed string */
  15.  
  16.     void    CopyString (Str255 String1, Str255 String2);
  17.     /* copy the entire contents of String1 into String2 */
  18.  
  19.     void PStrCpy (StringPtr Source, StringPtr Dest, short numToCopy);
  20.     /* Given two pascal strings, this routine replaces the contents of */
  21.     /* the second string with numToCopy characters of the first string */
  22.  
  23.     short PStrLen (StringPtr TheString);
  24.     /* return the length of the string; 0 if TheString is NULL */
  25.     
  26.     Boolean PStringCmp (StringPtr String1, StringPtr String2);
  27.     /* return TRUE if String1 is identical to String2 */
  28.  
  29.     short PStrCmp (StringPtr String1, StringPtr String2);
  30.     /* if String1 is > String2, return 1; if String1 is equal to String2, return 0; */
  31.     /* if String1 is < String2, return -1 */
  32.  
  33.     StringPtr PStrCat (short maxLen, Str255 Dest, short numArgs,...);
  34.     /* concatenate a variable number of StringPtr's and store the result in */
  35.     /* Dest; Dest will receive no more than maxLen characters, no matter how many */
  36.     /* StringPtr's are passed in */
  37.  
  38. #ifdef __cplusplus
  39. }
  40. #endif